package com.wuad.platformwuad.module.study.threadDemo;
/**
 * 获取线程信息的相关方法
 * @author adminitartor
 *
 */
public class ThreadInfoDemo {
	public static void main(String[] args) {
		//获取main线程
		Thread main = Thread.currentThread();
		//获取线程名字
		String name = main.getName();
		System.out.println("名字:"+name);
		
		//获取线程的唯一标示
		long id = main.getId();
		System.out.println("id:"+id);
		
		//获取线程的优先级
		int priority = main.getPriority();
		System.out.println("priority:"+priority);
		
		//获取线程是否处于活动状态
		boolean isAlive = main.isAlive();
		System.out.println("isAlive:"+isAlive);
		
		//获取该线程是否为守护线程
		boolean isDaemon = main.isDaemon();
		System.out.println("isDaemon:"+isDaemon);
		
		//线程是否被中断
		boolean isInterrupted = main.isInterrupted();
		System.out.println("isInterrupted:"+isInterrupted);
	}
}








